<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <canvas style="border: 2px solid red" width="500" height="400"></canvas>
  <script>
    var canvas = document.querySelector('canvas')
    var ctx = canvas.getContext('2d')
    // 起点
    ctx.moveTo(200,200)
    ctx.arc(200,200,100,0,0.5*Math.PI,false)
    ctx.closePath()
    // ctx.stroke()  // 描边
    ctx.fill()  // 填充
  </script>
</body>
</html>